<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/template.xhtml">
	<ui:define name="content">

		<h:form>
			<br />
			<br />
			<div class="middle">
				<h:messages class="myError" />
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h3><h:outputText value="#{msg.OM_manager_manageUsers}"/></h3>
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h:outputText value="#{msg.OM_crudusers_searchbyname}"></h:outputText>
				<h:inputText id="search" value="#{manageUserBean.search}">
					<f:ajax event="keyup" listener="#{manageUserBean.searchUsers}"
						render="userTable confMessage delError"></f:ajax>
				</h:inputText>
				<h:commandButton value="#{msg.OM_crudusers_newuser}"
					actionListener="#{manageUserBean.goToUsers}" class="button"></h:commandButton>
			</div>
			<h:outputText value="&lt;br/&gt;" escape="false" />
			<div class="middle">
				<h:outputText value="#{manageUserBean.confirmationMessage}"
					color="#890120" id="confMessage"></h:outputText>
				<h:outputText value="#{manageUserBean.deleteUserError}"
						id="delError"	style="color:#890120"></h:outputText>
			
			</div>
			<h:outputText value="&lt;br/&gt;" escape="false" />
			<h:dataTable id="userTable" border="0" class="table" var="user"
				value="#{manageUserBean.listManageUserDTO}"> 
				<h:column id="column1">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_name}"></h:outputText>
					</f:facet>
					<h:outputText value="#{user.name}"></h:outputText>
				</h:column>
				<h:column id="column2">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_username}"></h:outputText>
					</f:facet>
					<h:outputText value="#{user.username}"></h:outputText>
				</h:column>
				<h:column id="column3">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_email}"></h:outputText>
					</f:facet>
					<h:outputText value="#{user.email}"></h:outputText>
				</h:column>
				<h:column id="column4">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_domain}"></h:outputText>
					</f:facet>
					<h:outputText value="#{user.domain}"></h:outputText>
				</h:column>
				<h:column id="column5">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_active}"></h:outputText>
					</f:facet>
					<h:outputText value="#{user.active}"></h:outputText>
				</h:column>
				<h:column id="column6">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_usertype}"></h:outputText>
					</f:facet>
					<h:outputText value="#{user.usertype}"></h:outputText>
				</h:column>
				<h:column id="column7">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_edit}"></h:outputText>
					</f:facet>
					<h:commandButton class="editBtn" value="#{msg.OM_crudusers_editbutton}"
						actionListener="#{manageUserBean.editUserListener}">
						<f:attribute name="userid" value="#{user.userId}" />
					</h:commandButton>
				</h:column>
				<h:column id="column8">
					<f:facet name="header">
						<h:outputText value="#{msg.OM_crudusers_delete}"></h:outputText>
					</f:facet>
					<h:commandButton class="trashBtn" value="#{msg.OM_crudusers_deletebutton}"
						actionListener="#{manageUserBean.deleteUserListener}"
						onclick="#{msg.OM_crudusers_confMessage1}">
						<f:attribute name="userid" value="#{user.userId}" />

					</h:commandButton>
				</h:column>
			</h:dataTable>



		</h:form>

	</ui:define>
</ui:composition>

</html>